package com.woniuxy.yuekeuser.service.impl;

import com.woniuxy.yuekeuser.model.CampsiteFood;
import com.woniuxy.yuekeuser.dao.CampsiteFoodMapper;
import com.woniuxy.yuekeuser.model.CampsiteFoodPicture;
import com.woniuxy.yuekeuser.service.ICampsiteFoodService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Freedom
 * @since 2020-11-03
 */
@Service
public class CampsiteFoodServiceImpl extends ServiceImpl<CampsiteFoodMapper, CampsiteFood> implements ICampsiteFoodService {
@Autowired
private CampsiteFoodMapper campsiteFoodMapper;
    @Override
    public void addcampsiteFood(CampsiteFood campsiteFood) {
        campsiteFoodMapper.addcampsiteFood(campsiteFood);
    }

    @Override
    public void addCampsiteFoodImage(CampsiteFoodPicture campsiteFoodPicture) {
        campsiteFoodMapper.addCampsiteFoodImage(campsiteFoodPicture);
    }

    @Override
    public int findCampsiteFoodIdByFoodName(String foodName) {
        return campsiteFoodMapper.findCampsiteFoodIdByFoodName(foodName);
    }

    @Override
    public List<CampsiteFood> findFoods(String campsiteName,int index,int pageSize) {
        System.out.println(pageSize);
        return campsiteFoodMapper.findFoods(campsiteName,index,pageSize);
    }

    @Override
    public int findFoodCount(String campsiteName) {
        return campsiteFoodMapper.findFoodCount(campsiteName);
    }

    @Override
    public List<CampsiteFoodPicture> findFoodImagesByFoodId(int id) {
        return campsiteFoodMapper.findFoodImagesByFoodId(id);
    }

    @Override
    public String findFoodImageByFoodId(int id) {
        return campsiteFoodMapper.findFoodImageByFoodId(id);
    }


}
